
{extend name="layout/base"}
{block name="title"}恶意ip记录{/block}
{block name="css"}
<link href="__admin_static__/css/plugins/iCheck/custom.css" rel="stylesheet">
<link href="__admin_static__/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
{/block}
{block name="head_js"}{/block}
{block name="body"}
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">

    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>恶意ip记录　<a target="_self" href="javascript:void(0)" onclick="javascript:showModal();"><span class="btn btn-w-m btn-primary"><i class="glyphicon glyphicon-plus"></i> 添加恶意ip</span></a></h5>
                    <div class="ibox-tools">
                        <a class="collapse-link">
                            <i class="fa fa-chevron-up"></i>
                        </a>
                        <a class="close-link">
                            <i class="fa fa-times"></i>
                        </a>
                    </div>
                    <div class="clearfix" style="clear: both"></div>
                </div>

            </div>
        </div>

    </div>
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-content">
                    <form method="post" action="{:url('index')}" target="_self">
                        <div class="row">
                            <div class="col-sm-2  m-b-xs">
                                <div class="input-group">
                                    <input name="keyword" type="text" {if condition="!empty($input['keyword'])"}value="{$input['keyword']}"{/if} placeholder="输入关键词[ip]" class="input-sm form-control"> <span class="input-group-btn">
                                            <button type="submit" class="btn btn-sm btn-primary"> 搜索</button> </span>
                                </div>
                            </div>
                        </div>
                    </form>
                    <div class="table-responsive">
                        <form method="post" action="{:url('delAll')}" id="ListForm"  target="_self">
                            <table class="table table-striped">
                                <thead>
                                <tr>

                                    <th></th>
                                    <th>ip</th>
                                    <th>操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                {foreach name="list" item="data"}
                                <tr>
                                    <td>
                                        <input type="checkbox" class="i-checks" value="{$data.id}" name="id[]">
                                    </td>
                                    <td>{$data.ip}</td>
                                    <td>
                                        <a  target="_self" onclick="javascript:Base_warning_location({title:'你确定解禁吗',text:'解禁后无法还原哦',confirmText:'解禁',location:'{:url('del',['id'=>$data.id])}',});"><i class="glyphicon glyphicon-remove text-danger"></i></a>
                                    </td>
                                </tr>
                                {/foreach}
                                </tbody>
                            </table>
                        </form>
                    </div>
                    <div class="row">
                        <div class="col-sm-5 m-b-xs">
                            <div class="pagination">
                                <button type="button" class="btn btn-w-m btn-default" onclick="javascript:Base_warning_form({target:'ListForm','title':'您确定解禁该恶意ip吗'})">解禁</button>
                            </div>
                        </div>
                        <div class="col-sm-7 m-b-xs">
                            <nav aria-label="Page navigation">
                                <style>
                                    .pagination > .active > span{
                                        background-color: #1c84c6 !important;
                                        color: #fff;
                                        border-color: #1c84c6;
                                    }
                                </style>
                                {$page}
                            </nav>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="modal inmodal" id="myModal" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content animated bounceInRight">
            <form action="{:url('add')}" enctype="multipart/form-data" target="_self" method="post">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" onclick="javascript:showModal()"><span aria-hidden="true">&times;</span><span class="sr-only">关闭</span>
                    </button>
                    <i class="glyphicon glyphicon-plus modal-icon"></i>
                    <h4 class="modal-title">添加恶意ip</h4>
                    <small class="font-bold">您可以添加恶意ip，当添加后，该ip将无法进行对话聊天噢！</small>
                </div>
                <div class="modal-body">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">禁用ip</label>
                        <div class="col-sm-10">
                            <textarea  row="3" class="form-control" name="iplist" placeholder="您可以在本框内输入ip，如果是多个ip请用逗号隔开如 92.16.31,15.3.6"></textarea>
                            <span class="help-block m-b-none">必填)：请输入真实的ip，一旦被禁用，该ip将无法使用客服系统进行对话聊天，请慎重考虑</span>
                        </div>
                        <div class="clearfix"></div>
                    </div>
                </div>
                <div class="modal-footer">
                    <input type="hidden" name="fid" value="">
                    <button type="button" class="btn btn-white" onclick="javascript:showModal()">关闭</button>
                    <button type="submit" class="btn btn-primary" >确定禁用</button>
                </div>
            </form>
        </div>
    </div>
</div>

<script src="__admin_static__/js/jquery.min.js?v=2.1.4"></script>
<script src="__admin_static__/js/bootstrap.min.js?v=3.3.5"></script>
<script src="__admin_static__/js/plugins/peity/jquery.peity.min.js"></script>
<script src="__admin_static__/js/content.min.js?v=1.0.0"></script>
<script src="__admin_static__/js/plugins/iCheck/icheck.min.js"></script>
<script src="__admin_static__/js/demo/peity-demo.min.js"></script>
<script src="__admin_static__/js/plugins/sweetalert/sweetalert.min.js"></script>
<script src="__admin_static__/js/base.js"></script>
<script>
    $(document).ready(function(){
        $(".i-checks").iCheck({checkboxClass:"icheckbox_square-green",radioClass:"iradio_square-green",});

    });

    function showModal(fid)
    {
        var display = $('#myModal').css('display');
        if(display == 'none')
        {
            $('#myModal').addClass('in').show();
            $('#myModal input[name="fid"]').val(fid);
        }
        else
        {
            $('#myModal').removeClass('in').hide();
        }
    }

</script>
</body>
{/block}
